<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/react.development.js"></script>
    <script src="lib/react-dom.development.js"></script>
    <script src="lib/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
</body>
<script type="text/babel">
    // 1- 属性来自于父级（父组件）
    // 2- 父级是通过在调用子级（子组件）增加属性来传递的，比如
    //    <Child a={1} b={2}/>
    // 3- 子组件接收： this.props.a   this.props.b
    const root = ReactDOM.createRoot(document.querySelector("#root"));

    class App extends React.Component {
        render(){
            return (
                <Child userName={"zhangsan"} age={12}></Child>
            )
        }
    }
    class Child extends React.Component{
        render(){
            return (
                <div>
                    <p>userName:{this.props.userName}</p>
                    <p>age:{this.props.age}</p>
                </div>
            )
        }
    }

    root.render((
        <App></App>
    ))
</script>
</html>